import { storage } from '@/utils/storage'
/*
 * @Author: CQJ
 * @Date: 2022-08-25 20:00:27
 * @LastEditors: CQJ
 * @LastEditTime: 2022-09-02 17:56:40
 * @Description:
 */
import { reactive } from 'vue'

type Key = string
interface MakerState {
  // 全部状态
  person_status: number | undefined
  // 全部地区
  area_id: string | undefined
  //影人ID
  person_id: string | undefined
  // 子分类关键词
  person_keyword: string | undefined
  site_id: string | undefined
}

// 状态管理
export const makerState = reactive<MakerState>({
  person_status: undefined,
  area_id: undefined,
  person_id: undefined,
  person_keyword: undefined,
  site_id: undefined
})
// 状态管理
export const statusState = reactive<{ isEdit: boolean; addFilmMaker: boolean; selectedRowKeys: Key[] }>({
  isEdit: false,
  addFilmMaker: false,
  selectedRowKeys: []
})
export const resetState = () => {
  let key: keyof MakerState
  for (key in makerState) {
    makerState[key] = undefined
  }
}
